package cn.com.apple.service;

import cn.com.dcsgo.api.client.ItemClient;
import cn.com.dcsgo.api.dto.ItemDTO;
import cn.com.dcsgo.api.dto.OrderDetailDTO;
import cn.com.dcsgo.aspect.ApiOperationLog;
import cn.com.dcsgo.utils.BeanUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

import java.util.Collection;
import java.util.List;

@Service
public class ProductService{

    private final ItemClient itemClient;

    public ProductService(ItemClient itemClient) {
        this.itemClient = itemClient;
    }

    public List<ItemDTO> queryItemsByIds(Collection<Long> ids){
        return itemClient.queryItemsByIds(ids);
    }
    public void deductStock(List<OrderDetailDTO> items){
        itemClient.deductStock(items);
    }
    public void addStock(List<OrderDetailDTO> items){
        itemClient.addStock(items);
    }
    public Integer getStockById(Long id){
        return itemClient.getStockById(id);
    }

}